#include <stdio.h>
#include <string.h>
#define N 5

int main() {
	char t[N][30], (*p)[30], (*q)[30], (*r)[30], tl[30];
	int i = 0;
	for (p = t; p < t + N; p++)
		scanf( "%s", *p );
	for (p = t; p < t + N - 1; p++) {
		q = p;
		for (r = p + 1; r < t + N; r++)
			if ( strcmp(*q, *r) > 0)
				q = r;
		if (q != p) {
			strcpy(tl, *p );
			strcpy(*p, *q);
			strcpy(*q, tl);
		}
	}
	for (p = t; p < t + N; p++)
		printf("%s\n", *p );
}
